package com.type;

import java.io.DataOutputStream;
import java.io.IOException;
import java.util.ArrayList;

public class Commenter extends Follower {
	ArrayList<Comment> commentList = new ArrayList<Comment>();
	
	public Commenter(long phoneNumber, Comment comment) {
		super(phoneNumber);
		commentList.add(comment);
	}
	
	public ArrayList<Comment> getCommentList() {
		return commentList;
	}
	
	@Override
	public void send(DataOutputStream dos) throws IOException, InterruptedException {
		super.send(dos);
		if(commentList.isEmpty()) {
			dos.writeInt(0);
		} else {
			dos.writeInt(commentList.size());
			for(Comment comment : commentList)
				comment.send(dos);
		}
	}
}
